{% extends "base.html" %}

{% block title %}
	Login
{% endblock %}

{% block user %} {{ current_user.username }} {% endblock %}

{% block body %}
	<div class="col-lg-3">
		<!-- Set the form -->
		<form method="POST" action="{{ url_for('main.login') }}"> 
			
			{{ form.hidden_tag() }}
			<div>
				{{ form.username.label }} <!-- step1 -->
			
				{% if form.username.errors %} <!-- step3 -->
					{% for e in form.username.errors %}
						<p class="help-block">{{ e }}</p>
					{% endfor %}
				{% endif %}
				
				{{ form.username(class_="form-control") }} <!-- step2 -->
			</div>
			
			<div class="form-group">
				{{ form.password.label}}
				
				{% if form.password.errors %}
					{% for e in form.password.errors %}
						<p class="help-block">{{ e }}</p>
					{% endfor %}
				{% endif %}
				
			{{ form.password(class_='form-contorl') }}
			</div>
			<div>
				{{ form.remember.label }} {{ form.remember() }}
			</div>
			
			<input class="btn btn-primary" type="submit" value="Login">
		</form>
	</div>
{% endblock %}
